package com.ucap.bbs.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ucap.bbs.dao.IUsersDao;
import com.ucap.bbs.pojo.Users;
import com.ucap.bbs.util.bean.LoginUesrBean;

@SuppressWarnings("unchecked")
public class UsersDaoImpl extends SqlMapClientDaoSupport implements IUsersDao{

	@Override
	public List<Users> test() {
		List<Users> list =  getSqlMapClientTemplate().queryForList("QUERY_USER_LIST", new Users());
        if(null!=list){
            return list;
        }
        return null;
	}

	@Override
	public Users login(Users queryUsers) {
		Users users =  (Users)getSqlMapClientTemplate().queryForObject("USER_LOGIN", queryUsers);
        if(null!=users){
            return users;
        }
        return null;
	}

	@Override
	public void insert(Users users) {
		getSqlMapClientTemplate().insert("INSERT_USERS",users);
	}
	
}
